<?php
class AnniversaryInfoVo extends SzAbstractMySqlVo
{

    private $userId;
    private $aId;
    private $preferential;
    private $cdTime;
    private $checkRecord;
    private $overRecord;
    private $remarks;
    private $checkTime;
    private $createTime;
    private $updateTime;
    private $endTime;

    /**
     * Initialize AnniversaryInfoVo.
     *
     * @param $userId
     * @param $aId
     * @param $preferential
     * @param $cdTime
     * @param $checkRecord
     * @param $overRecord
     * @param $remarks
     * @param $checkTime
     * @param $createTime
     * @param $updateTime
     * @param $endTime
     * @param boolean $isInsert default false, means for now this vo is initialized not for insert process
     * @return AnniversaryInfoVo
     */
    public function __construct($userId, $aId, $preferential, $cdTime, $checkRecord, $overRecord, $remarks, $checkTime, $createTime, $updateTime, $endTime, $isInsert = false) {
        $this->userId = $userId;
        $this->aId = $aId;
        $this->preferential = $preferential;
        $this->cdTime = $cdTime;
        $this->checkRecord = json_decode($checkRecord, true);
        $this->overRecord = json_decode($overRecord, true);
        $this->remarks = json_decode($remarks, true);
        $this->checkTime = $checkTime;
        $this->createTime = $createTime;
        $this->updateTime = $updateTime;
        $this->endTime = $endTime;

        $this->isInsert = $isInsert;
        $this->voClassName = 'AnniversaryInfoVo';
        $this->ormName = 'AnniversaryInfo';
    }

    /**
     * @see SzAbstractVo::toArray
     */
    public function toArray($needEncode = false)
    {
        return array(
            'userId' => $this->getUserId(),
            'aId' => $this->getAId(),
            'preferential' => $this->getPreferential(),
            'cdTime' => $this->getCdTime(),
            'checkRecord' => ($needEncode) ? $this->getCheckRecord() : $this->getRawCheckRecord(),
            'overRecord' => ($needEncode) ? $this->getOverRecord() : $this->getRawOverRecord(),
            'remarks' => ($needEncode) ? $this->getRemarks() : $this->getRawRemarks(),
            'checkTime' => $this->getCheckTime(),
            'createTime' => $this->getCreateTime(),
            'updateTime' => $this->getUpdateTime(),
            'endTime' => $this->getEndTime(),
        );
    }

    /**
     * @see SzAbstractVo::toEntireArray
     */
    public function toEntireArray($needEncode = false)
    {
        return array(
            'userId' => $this->getUserId(),
            'aId' => $this->getAId(),
            'preferential' => $this->getPreferential(),
            'cdTime' => $this->getCdTime(),
            'checkRecord' => ($needEncode) ? $this->getCheckRecord() : $this->getRawCheckRecord(),
            'overRecord' => ($needEncode) ? $this->getOverRecord() : $this->getRawOverRecord(),
            'remarks' => ($needEncode) ? $this->getRemarks() : $this->getRawRemarks(),
            'checkTime' => $this->getCheckTime(),
            'createTime' => $this->getCreateTime(),
            'updateTime' => $this->getUpdateTime(),
            'endTime' => $this->getEndTime(),
        );
    }

    /**
     * @see SzAbstractVo::toPureArray
     */
    public function toPureArray()
    {
        return array(
            $this->getUserId(),
            $this->getAId(),
            $this->getPreferential(),
            $this->getCdTime(),
            $this->getCheckRecord(),
            $this->getOverRecord(),
            $this->getRemarks(),
            $this->getCheckTime(),
            $this->getCreateTime(),
            $this->getUpdateTime(),
            $this->getEndTime(),
        );
    }

    public function getUserId()
    {
        return $this->userId;
    }

    public function setUserId($val)
    {
        $this->saveColumnStatus(0, $this->userId);
        $this->userId = $val;
    }

    public function getAId()
    {
        return $this->aId;
    }

    public function setAId($val)
    {
        $this->saveColumnStatus(1, $this->aId);
        $this->aId = $val;
    }

    public function getPreferential()
    {
        return $this->preferential;
    }

    public function setPreferential($val)
    {
        $this->saveColumnStatus(2, $this->preferential);
        $this->preferential = $val;
    }

    public function getCdTime()
    {
        return $this->cdTime;
    }

    public function setCdTime($val)
    {
        $this->saveColumnStatus(3, $this->cdTime);
        $this->cdTime = $val;
    }

    public function getCheckRecord()
    {
        return json_encode($this->checkRecord);
    }

    public function getRawCheckRecord()
    {
        return $this->checkRecord;
    }

    public function setCheckRecord($val)
    {
        $encodedLength = SzUtility::strLen(json_encode($val));
        if ($encodedLength > 25600) {
            SzLogger::get()->error('[AnniversaryInfoVo] The length of column checkRecord exceed the limit, length / limit: ' . $encodedLength . ' / 25600');
            throw new SzException(10522, array('AnniversaryInfoVo', '25600', $encodedLength));
        } else if ($encodedLength > 23040) {
            SzLogger::get()->warn('[AnniversaryInfoVo] The length of column checkRecord exceed the warning level, length / limit: ' . $encodedLength . ' / 25600');
        }
        $this->saveColumnStatus(4, $this->checkRecord);
        $this->checkRecord = $val;
    }

    public function getOverRecord()
    {
        return json_encode($this->overRecord);
    }

    public function getRawOverRecord()
    {
        return $this->overRecord;
    }

    public function setOverRecord($val)
    {
        $encodedLength = SzUtility::strLen(json_encode($val));
        if ($encodedLength > 25600) {
            SzLogger::get()->error('[AnniversaryInfoVo] The length of column overRecord exceed the limit, length / limit: ' . $encodedLength . ' / 25600');
            throw new SzException(10522, array('AnniversaryInfoVo', '25600', $encodedLength));
        } else if ($encodedLength > 23040) {
            SzLogger::get()->warn('[AnniversaryInfoVo] The length of column overRecord exceed the warning level, length / limit: ' . $encodedLength . ' / 25600');
        }
        $this->saveColumnStatus(5, $this->overRecord);
        $this->overRecord = $val;
    }

    public function getRemarks()
    {
        return json_encode($this->remarks);
    }

    public function getRawRemarks()
    {
        return $this->remarks;
    }

    public function setRemarks($val)
    {
        $encodedLength = SzUtility::strLen(json_encode($val));
        if ($encodedLength > 25600) {
            SzLogger::get()->error('[AnniversaryInfoVo] The length of column remarks exceed the limit, length / limit: ' . $encodedLength . ' / 25600');
            throw new SzException(10522, array('AnniversaryInfoVo', '25600', $encodedLength));
        } else if ($encodedLength > 23040) {
            SzLogger::get()->warn('[AnniversaryInfoVo] The length of column remarks exceed the warning level, length / limit: ' . $encodedLength . ' / 25600');
        }
        $this->saveColumnStatus(6, $this->remarks);
        $this->remarks = $val;
    }

    public function getCheckTime()
    {
        return $this->checkTime;
    }

    public function setCheckTime($val)
    {
        $this->saveColumnStatus(7, $this->checkTime);
        $this->checkTime = $val;
    }

    public function getCreateTime()
    {
        return $this->createTime;
    }

    public function setCreateTime($val)
    {
        $this->saveColumnStatus(8, $this->createTime);
        $this->createTime = $val;
    }

    public function getUpdateTime()
    {
        return $this->updateTime;
    }

    public function setUpdateTime($val)
    {
        $this->saveColumnStatus(9, $this->updateTime);
        $this->updateTime = $val;
    }

    public function getEndTime()
    {
        return $this->endTime;
    }

    public function setEndTime($val)
    {
        $this->saveColumnStatus(10, $this->endTime);
        $this->endTime = $val;
    }

}